# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-python-ipware
_pyname="python-ipware"
pkgver=3.0.0
pkgrel=0
arch="noarch"
pkgdesc="A python package for server applications to retrieve client's IP address"
url="https://pypi.python.org/project/python-ipware"
license="MIT"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="py3-pytest"
source="$pkgname-$pkgver.tar.gz::https://github.com/un33k/python-ipware/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/$_pyname-$pkgver
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a901b0e09f1a0d0b53725d41272e24c7cc3a0ea3250e7210de42fb233b196b8ff28153d0657a13031e5ac9618958005574230969f97a109a7bb91409d42228d5  py3-python-ipware-3.0.0.tar.gz
"
